package com.principle.facade;

/**
 * 外观者模式的封装：统一接口封装,将子系统的逻辑，交互封装隐藏起来,提供一个更高层次的接口
 * @author zhonghong.zhangxg
 * @date 2016年7月15日上午10:33:19
 */
public class MobliePhone {
    private IPhone mPhone = new PhoneImpl();
    private ICamera mCamera = new CameraImpl();

    public void dial() {
        mPhone.dial();
    }
    
    public void videoChat() {
        mCamera.open();
        mPhone.dial();
    }
    
    public void hangup() {
        mPhone.hangup();
    }
    
    public void takePicture() {
        mCamera.open();
        mCamera.takePicture();
    }
    
    public void closeCamera() {
        mCamera.close();
    }
}
